#pragma once

#include "BlockingQueue.h"
namespace TinyRPC{

template<typename  T>
T BlockingQueue<T>::take(){
    T t(std::move(m_tasks.front()));
    m_tasks.pop_front();
    return t;
}
template<typename  T>
void BlockingQueue<T>::push(const T& task){
    std::unique_lock<std::mutex> lock(m_mutex);
    m_tasks.push_back(task);
}
template<typename  T>
void BlockingQueue<T>::push(T&& task){
    std::unique_lock<std::mutex> lock(m_mutex);
    m_tasks.push_back(std::move(task));
}

}
